-
Notifications
You must be signed in to change notification settings - Fork 870
Add documentation for new custom flow APIs #2680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
I think we need a calllout for these docs, since we don't support versioning. Warning This API is available only for and then for the legacy ones, Warning You're viewing docs for an older version of Clerk's APIs. If you're using what version did we introduce the new |

🔎 Previews:
What does this solve?
This PR adds documentation for our new custom flows APIs, which are available in JavaScript-based SDKs built on top of React. These APIs will become the default APIs in the next major version of
@clerk/react.What changed?
One of the challenges of documenting these new APIs is that they've diverged from the APIs previously used for other SDKs, primarily our iOS and Android SDKs. This poses a unique challenge because the concept of what must be done to accomplish a sign-in or sign-up is now dependent upon the SDK used, whereas the current documentation depends on all SDKs using the same foundational ideas. For example, the new APIs no longer have the concept of "preparing", which the current docs reference. To alleviate this, the new guides utilize the
<If>conditional component to selectively render different language and code examples based on the selected SDK, which allows us to directly reference the new API methods when the currently selected SDK is one that utilizes the new APIs.This, however, causes another issue, which is what content should be shown when the current selected SDK doesn't have any examples for custom flows? As is, selecting a SDK such as Express would result in neither of the
<If>statements being true, which would prevent any content from showing. To prevent showing blank content, the new guides utilize thesdkfront matter attribute to only show the guides in the sidebar when a relevant SDK is selected.Also, since the previous APIs are still available for backwards compatibility, the original docs have been copied to the
/legacyfolder to allow customers to still access the guides for reference.Note
As of writing, the legacy guides do not utilize the
sdkfront matter attribute, but they probably should, otherwise the sidebar will look like this:The new custom flow APIs are built upon the
SignInFutureandSignUpFutureclasses. The documentation for these new classes have been added alongside the existingSignInandSignUpAPI documentation, and serves as the canonical reference documentation for thesignInandsignUpexports of the newuseSignInanduseSignUphooks.Checklist